1. Field of the Invention
The present invention relates to an automatic focusing device, an environment recognizing device, etc., of a camera.
2. Description of Related Art
An art of optically measuring distances to objects located in different directions is disclosed in Japanese Patent Publication No. HEI 4-67607. This art enables a camera to obtain information on a distribution of distances to objects located in a photo-taking field (hereinafter referred to as the distance distribution) or information on a distribution of defocused states in the photo-taking field (hereinafter referred to as the defocus distribution). The information permits recognition as to how objects are located in the photo-taking field.
A typical environment recognizing method which has been adopted in general is as described below.
A shot of a scene such as that shown in FIG. 11(a) is taken, for example, with a stereo camera using a CCD or the like. Two images having a parallax relative to each other are obtained by the stereo camera. Each of the two images is divided into m.times.n blocks. A known correlation computing operation is performed on a signal obtained from within a certain block of one of the two images and a signal obtained from a corresponding block of the other image. Then, a distance to an object within the block and an amount (degree) of defocus can be measured on the principle of trigonometric measurement. This measuring action is performed for all the blocks. As a result, information on a distribution of distances or a distribution of defocused states obtained from the m .times.n blocks can be obtained as shown in FIG. 11(b).
Next, to separate objects forming a phototaking field from each other on an image plane, an area dividing process is performed. The space of the phototaking field which consists of the above-stated m.times.n blocks is divided into areas of objects as shown in FIG. 11(c). In FIG. 11(c), hatched parts represent areas where the reliability of results of the correlation computing operation is considered to be low due to insufficiency of contrast obtained in image signals.
According to one known method of dividing the areas, parameters relative to adjacent blocks among the blocks forming the space of the photo-taking field are compared with each other to find a degree of resemblance between them. If the degree of resemblance is high, they are decided to represent the same object, and if the degree of resemblance is low, they are decided to represent different objects. Information to be used as the parameter for the area dividing process is a normal vector of surface in most cases where fine distance distribution information is obtainable. In the case of this example of prior art where information on the distance or defocus distribution is obtained in a relatively coarse state, however, the degree of resemblance is detected by simply comparing distance values or defocus values of the adjacent blocks.
For example, in the case of distance information of blocks shown in FIG. 11(b), the distance information value of one of two adjacent blocks is compared with that of the other block. If a difference in distance between the two adjacent blocks is found to be not exceeding a predetermined threshold value, the two blocks are decided to form one and the same object. If the difference in distance is found to be larger than the predetermined threshold value, the two adjacent blocks are decided to represent different objects. The comparing and deciding processes are carried out, comparing one block with another among all blocks in an adjoining relation. The whole image plane thus can be divided into areas which represent different objects. Each of the divided areas thus can be handled as a group representing one object.
The art of recognizing an environment by dividing areas for different objects within one image plane in the above-stated manner is applicable, for example, to an automatic travelling robot which decides the direction of its travel by itself, a vehicle which automatically avoids dangers by recognizing obstacles existing before and after it, etc.
The applications of the art further include an air conditioner which appositely controls its air blowing action by detecting a main object within an image plane through evaluation of areas and by deciding the direction in which a person or persons are located within a room, a camera arranged to recognize a main object of shooting and to adjust focus on the main object, and a camera arranged to be capable of measuring light only for a main object of shooting and appositely adjusting focus on the main object even in a back-light shooting condition. The art thus has a wide range of applications.
In carrying out the area dividing action, areas are decided to represent or not to represent one and the same object on the basis of a difference between the two distances as mentioned above. This method has been practiced on the assumption that, in the case of one and the same object, a surface of the object is usually slanting nearly perpendicular to an optical axis and, as a result, the difference between the two distances becomes small in such a case.
However, an interval between distance measuring points which correspond to the adjacent blocks, i.e., an interval obtained between two points not in the direction of depth but in the vertical or lateral direction on the image plane, becomes wider in proportion to the distance in the object space. FIG. 12 shows how the interval between the measuring points spreads in the object space. In FIG. 12, the abscissa axis shows an optical axis and the ordinate axis shows an optical center of an ideal image forming system. Two distance measuring points M1 and M2 are on an image forming plane. In the object space on the left side of an origin, an interval between the two measuring points becomes wider accordingly as a distance from an ideal lens (of the ideal image forming system) increases. In other words, the interval between the two measuring points is narrow when an object located at a near distance A is measured and becomes wider when another object which is located at a far distance B is measured.
Therefore, even in the case of one and the same object having a certain angle with respect to the optical axis, the difference in distance remains within a threshold value to cause the object to be judged as one and the same object if the object is measured from a near distance and becomes larger than the threshold value to cause the same object to be judged as different objects when the same object is measured from a far distance. (The threshold value of 50 cm or thereabout is adequate for an object located at a near distance, as the interval between the measuring points is narrow. However, the same threshold value becomes inadequate for an object located at a far distance, as the interval between the measuring points is wider and the object tends to be misjudged as different objects.) In other words, the result of the recognizing action varies with the distance even for the same object.
In a case where the above-stated recognizing action is to be carried out by a single-lens reflex camera, the recognizing action is performed usually on the basis of defocus information, instead of distance information. In dividing areas, therefore, two adjacent blocks are judged to form one and the same object, if a difference in defocus between the two blocks is found to be not exceeding a predetermined value.
However, the degree of defocus is in a nonlinear relation to the distance (of the object) as indicated by a full line curve in FIG. 13. The predetermined value thus does not become a fixed value in a distance space. The above-stated threshold value is a relatively small value in the distance space on the side of near distances, i.e., on the side where the degrees of defocus are in positive values, and is a relatively large value in the distance space on the side of far distances, i.e., on the side where the degrees of defocus are in negative values.
As a result of this, the area dividing action is performed for objects on the side of near distances by considering them to be different (separate) objects even when the difference in distance is small. As for objects located on the side of far distances, the area dividing action is performed by considering them to be one and the same object even in the event of such a difference in distance that permits handling them as separate (different) objects. The area dividing action thus has been performed in a disproportional manner. It is hardly possible to accurately recognize the apace of photo-taking field under such a condition.
Although the influence of defocused states is acting in the direction of offsetting an influence attributable to the above-stated relation of the object distance to the interval between the measuring points, the latter is not completely offset by the former. This is because the influence of defocus is acting in a nonlinear manner while the influence attributable to the interval is linearly acting. The adverse effect of this saliently appears in the areas of the nearest distance and those of the farthest distance in particular.
Further, with respect to the variation of the focus position of the lens, the characteristic of the relation of the degree of defocus to the distance varies in a state of shifting in parallel with the full line curve in the direction of the ordinate axis, as indicated by broken lines in FIG. 13. Therefore, the range of the threshold value in the distance space also varies with respect to changes in the current focus position of the lens. As a result, the result of the area dividing action varies when the focus position of the lens varies even for the same photo-taking field.